Conventionally, in a system or the like for transmitting a bit stream of moving images or recording the bit stream on a recording medium, high-efficiency encoding is performed to efficiently use a transmission path or recording capacity. In an image encoding device for realizing the high-efficiency encoding, the encoding bit rate of a bit stream generated by an encoder is set to a certain rate according to the transfer rate of a transmission medium. Under this restriction, the quantity of data to be generated, i.e., the quantization step of quantization in the encoder, is controlled. That is, the quantization step is increased to suppress the quantity of data to be generated when images having a complicated picture pattern continue, for example, whereas the quantization step is decreased to increase the quantity of data to be generated when images having a simple picture pattern continue, whereby a fixed rate is maintained to prevent overflow or underflow of a buffer memory.
Therefore, in the image encoding device according to such a related art, the quantization step increases to degrade image quality when complicated images continue, whereas the quantization step decreases when simple images continue, so that uniform image quality cannot be obtained as a whole. In view of this problem, for example, Patent Document 1 discloses an image encoding device that calculates an assigned code quantity to be assigned to each GOP (Group Of Pictures) itself in accordance with the ratio between difficulty in encoding of each GOP and the total sum of difficulties in encoding of a plurality of GOPs so that a large quantity is assigned to a GOP including an image having a complicated picture pattern and that a small quantity is assigned to a GOP including an image having a simple picture pattern.
On the other hand, as a method for adjusting a generated code quantity to a target code quantity given to one picture, step 2 of TM5 (test model 5) is well known, for example. In this method, a code quantity assigned to a picture is evenly distributed to macro blocks (MBs), each distributed quantity being set as a target code quantity of each MB, and adjustment to the target code quantity is performed through feedback control in the picture.                Patent Document 1: Japanese Patent No. 3358620        
However, in the above-described method of step 2 of TM5, degradation of image quality may occur in encoding of a picture at the top of a sequence or a picture just after change of a scene because the initial value of the quantization step does not conform to the pattern of the picture.
For example, in a case where the quantization step in a portion before feedback control follows the picture pattern is too large, the image quality of the portion is degraded compared to the other portion. In a case where the quantization step is too small, too much code quantity is used in the portion and the influence thereof may be exerted on the other portion.
Also, since the target code quantity of an MB is always kept constant, inappropriate distribution of code quantity occurs when difficulty of an image is uneven in a screen. In these circumstances, an image encoding device should desirably predict a generated code quantity by executing encoding in parallel in advance and adjust the generated code quantity to a target code quantity given to one picture without executing intra-screen feedback control. However, if the image encoding device executes quantization in parallel in accordance with the number of quantization parameters, the circuit scale increases disadvantageously.